# 批量创建活动数据

import requests
import json

url = "https://crmbeta.hongsong.info/crmapi/api/edu-fengjin-crm-homepage-web/position/upsert"

headers = {
   'istio-v': 'feature-home-plaza',
   'loginsource': 'crm',
   'pragma': 'no-cache',
   'priority': 'u=1, i',
   'token': 'eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJsaXVob25nMDFAaG9uZ3NvbmcuY2x1YiIsImNyZWF0ZWQiOjE3Mjk1MTI3NDczMjIsImV4cCI6MTczMjEzOTMwN30.nV-M6r_-ETMzaE5RwVJnG3iqJ12jEub31MyhjK75jBooTrpzYVpWcSmko2iCsgCeDoBKiuryQRDofcoG0okqqw',
   'userid': 'null',
   'x-hs-employee-token': '[object Object]',
   'User-Agent': 'Apifox/1.0.0 (https://apifox.com)',
   'content-type': 'application/json'
}

num = 13
for i in range(100):
    payload = json.dumps({
       "data": {
          "positionName": f"首页活动第{num}个位置",
          "channelId": 31,
          "positionIndex": f"{num}",
          "advertisementIds": []
       }
    })
    if num <= 101:
        response = requests.request("POST", url, headers=headers, data=payload)

    print(response.text)
    num += 1
